import { BlockEnum } from '@/components/workflow/types'
import { generateUUID } from '@/utils'
import { ALL_COMPLETION_AVAILABLE_BLOCKS } from '../../constants'
import { DocExtractorNodeType } from './types'

export const getTextConcatenationDefaultParams = () => {
  return {
    inputList: [
      {
        id: generateUUID(8),
        type: 'string',
        label: '输入文本',
        variable: 'input',
        required: true,
        value: '',
      }
    ],
    outputList: [
      {
        id: generateUUID(8),
        variable: 'output', // 变量名
        value: '拼接结果', // 文档提取输出
        type: 'string', // 变量类型
      }
    ],
    separator: '\n'  // 默认使用换行符作为分隔符
  }
}

export default {
  getAvailablePrevNodes() {
    const nodes = ALL_COMPLETION_AVAILABLE_BLOCKS.filter(type => type !== BlockEnum.End)
    return nodes
  },
  getAvailableNextNodes() {
    const nodes = ALL_COMPLETION_AVAILABLE_BLOCKS
    return nodes
  },
  checkValid: (payload: DocExtractorNodeType) => {
    return true
  }
}